Skip to content

test(query-devtools/PiPContext): assert exact spy arguments instead of 'objectContaining'/'stringContaining'#11052

Merged
sukvvon merged 1 commit into
mainfrom
test/query-devtools-pipcontext-exact-observer-options
Jul 12, 2026
Merged

test(query-devtools/PiPContext): assert exact spy arguments instead of 'objectContaining'/'stringContaining'#11052
sukvvon merged 1 commit into
mainfrom
test/query-devtools-pipcontext-exact-observer-options

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 12, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Two assertions in PiPContext.test.tsx matched spy arguments partially, so they skipped fields the source actually passes. Both are now pinned to the exact value.

  • should observe the parent "#_goober" style...observe was checked with expect.objectContaining({ childList: true, subtree: true }), which ignores extra keys and silently skipped characterDataOldValue. Now asserts the full options object:

    observer.observe(gooberStyles, {
      childList: true,
      subtree: true,
      characterDataOldValue: true,
    })
  • should reset "pip_open"/"open" and log when "window.open" returns null on auto-openconsole.error was checked with expect.stringContaining('Failed to open popup'), matching only a prefix. The source logs a fixed PipOpenError message, so the assertion now pins the full string.

✅ Checklist

🚀 Release Impact

  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Tightened assertions for the PiP auto-open failure scenario to expect the exact console.error message when popup opening returns null.
    • Strengthened MutationObserver-related coverage to verify observation options fully include childList, subtree, and characterDataOldValue: true.

@nx-cloud

nx-cloud Bot commented Jul 12, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit b460ff5

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 7s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-12 03:27:44 UTC

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

PiP context tests now assert the exact auto-open popup failure message and require MutationObserver.observe to receive the complete #_goober options object.

Changes

PiP test validation

Layer / File(s) Summary
Popup failure and observer assertions
packages/query-devtools/src/__tests__/contexts/PiPContext.test.tsx
The tests require the exact console.error message when window.open returns null and explicitly verify childList, subtree, and characterDataOldValue: true observer options.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested labels: package: query-devtools

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the test assertion tightening in PiPContext and matches the main change.
Description check ✅ Passed The description follows the template and includes the required Changes, Checklist, and Release Impact sections.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/query-devtools-pipcontext-exact-observer-options

Comment @coderabbitai help to get the list of available commands.

@sukvvon sukvvon self-assigned this Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Jul 12, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11052

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11052

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11052

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11052

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11052

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11052

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11052

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11052

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11052

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11052

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11052

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11052

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11052

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11052

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11052

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11052

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11052

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11052

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11052

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11052

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11052

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11052

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11052

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11052

commit: a5852c8

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.13 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon force-pushed the test/query-devtools-pipcontext-exact-observer-options branch from b460ff5 to a5852c8 Compare July 12, 2026 03:23
@sukvvon sukvvon changed the title test(query-devtools/PiPContext): assert the exact 'MutationObserver' options instead of 'objectContaining' test(query-devtools/PiPContext): assert exact spy arguments instead of 'objectContaining'/'stringContaining' Jul 12, 2026
@sukvvon sukvvon merged commit 8773a15 into main Jul 12, 2026
9 checks passed
@sukvvon sukvvon deleted the test/query-devtools-pipcontext-exact-observer-options branch July 12, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant